﻿<%@ Page language="c#" Inherits="Mysoft.Crm.Web.Controls.Lookup.LookupSinglePage" CodeBehind="Mysoft.Crm.Application.Pages.Controls.dll" %>
<%@ Register TagPrefix="cnt" Namespace="Mysoft.Crm.Application.Controls" Assembly="Mysoft.Crm.Application.Components" %>
<%@ Register TagPrefix="frm" Namespace="Mysoft.Crm.Application.Forms" Assembly="Mysoft.Crm.Application.Components" %>
<%@ Import Namespace="Mysoft.Crm.Web.Controls.Lookup"%>
<!-与crm组比较差异,上面命名空间和下面css和js ->
<html>
<head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312"/>

<link rel="stylesheet" type="text/css" href="/_forms/styles/form.css">
<link rel="stylesheet" type="text/css" href="/_common/styles/dialogs.css">
<script language="javascript" src="/_controls/settings.aspx"></script>
<script language="javascript" src="/_forms/addrelated.js"></script>
<script language="javascript" src="/_controls/util/util.js"></script>
<script language="javascript" src="/_controls/number/number.js"></script>
<link rel="stylesheet" type="text/css" href="/_common/styles/select.css">
<link rel="stylesheet" type="text/css" href="/_common/styles/global.css">
<script language="javascript" src="/_controls/util/util.js"></script>
<script language="javascript" src="/_common/scripts/global.js"></script>
<title>查找记录</title><!-汉化//^^ ->

	<cnt:AppHeader id="crmHeader" runat="server" />
	<link rel="stylesheet" type="text/css" href="lookupdialogs.css">
	<script language="javascript" src="lookupdialogs.js"></script>
	
	<script language="javascript">
<%
		RenderCreatePrivileges();
%>	
		_mode = <%=(uint)Mode%>;
	
		function applychanges()
		{
			selectItem();
		}
		
		function cancel()
		{
			window.close();
		}
		
		function window.onload()
		{ 
			if ( !checkMode( _mode, LookupBrowse ) )
			{
				findValue.focus();
			}
			else
			{
				frmResults.focus();	
			}
		}
	
		function resultsReady()
		{
			if ( frmResults.document.readyState == "complete" )
			{
				document.body.style.cursor = "auto";

				if ( !checkMode( _mode, LookupBrowse ) )
				{
					btnGo.disabled = false;
				}
				
				setNavigationState();
			}
		}

		function selectItem()
		{
			if (frmResults.tblResults != undefined)
			{
				if( frmResults.tblResults.selectedItems )
				{
					window.returnValue = buildReturnValue( frmResults.tblResults.selectedItems );
					window.close();
				}
			}
			else
			{
				window.close();
			}
		}
		
		function appendSelected()
		{
			selectItem();
		}
		
		function setNavigationState()
		{
			//	single lookups always have two items ('none' and header)
			//
			if (frmResults.tblResults != undefined)
			{
				btnProperties.disabled = ( frmResults.tblResults.rows.length <= 2 );
			}
		}
	
	</script>
</head>

<body>
	<frm:DialogForm id="crmForm" runat="server">
		<table cellspacing="0" cellpadding="0" width="100%" height="100%">
			<tr>
				<td class="search">
					<% RenderSearchHeader(); %>
				</td>
			</tr>
			<tr>
				<td>
					<table height="100%" width="100%" id="tblFind" cellpadding="0" cellspacing="0">
						<col width="30">

						<tr height="20">
							<td>可用记录:</td><!-//^^->
						</tr>

						<tr>
							<td colspan="3" style="padding-top: 5px">
								<% RenderResultsFrame(); %>
							</td>
						</tr>
						
						<tr style="padding-top: 10px;" height="40">
							<td nowrap colspan="3">
								<% RenderButtons(); %>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</frm:DialogForm>
</body>
</html>
